package com.sss.hloster04;

public class JavaExercise19 {

	public static void main(String[] args) {
		test19();

	}

	/**
	 * 打印菱形
	 */

	private static void test19() {
		for (int i = 1; i <= 9; i++) {
			if (i <= 5) {// 打印菱形上半部分

				for (int j = 1; j <= 5 - i; j++) {
					System.out.print(" ");
				}
				for (int s = 1; s <= 2 * i - 1; s++) {
					System.out.print("*");
				}
				System.out.println();
			} else {// 打印菱形的下半部分
				for (int x = 1; x <= i - 5; x++) {
					System.out.print(" ");
				}
				for (int y = 1; y <= 2 * (10 - i) - 1; y++) {
					System.out.print("*");
				}
				System.out.println();
			}
		}
	}
}
